package ch09_io.redconfig;

import org.apache.commons.io.FileUtils;
import org.junit.Test;
import org.springframework.util.ResourceUtils;

import java.io.File;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.Properties;

/**
 * 从文件中读取内容
 *
 * @author guodd
 * @version 1.0 use jdk 1.8
 */
public class RedConfig {
    @Test
    public void json() throws Exception {
        Properties properties = new Properties();
        File file01 = ResourceUtils.getFile("info.json");
        URL url = ResourceUtils.getURL("www.baidu.com");
        String s = FileUtils.readFileToString(ResourceUtils.getFile("classpath:log4j.properties"), StandardCharsets.UTF_8);
    }
}
